package team.yidong.fenda.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import team.yidong.fenda.entity.User;

import java.util.List;

/**
 * Created by xuanlong on 2017/10/14.
 */
@Repository
public interface UserRepository extends JpaRepository<User, Integer>, JpaSpecificationExecutor<User> {
    @Query("select user from User user join user.hospital hospital where hospital.id=?1 ")
    List<User> findUserBYHospitalId(Integer id);

    List<User> findByIsBlack(String isBlack);

    User findByUserOpenId(String userOpenId);
}
